<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\massage\model;

class Appeal extends \app\BaseModel
{
    protected $name = "massage_service_coach_appeal";
    public static function getList($where, $page = 10)
    {
        $data = self::where($where)->alias("a")->field("a.uniacid,a.id,a.create_time,a.order_code,a.order_id,a.content,a.status,a.reply_content,a.reply_date,b.coach_name,b.mobile")->leftJoin("massage_service_coach_list b", "a.coach_id=b.id")->order("a.create_time desc")->paginate($page)->each(function ($item) {
            $item["create_time"] = date("Y-m-d H:i:s", $item["create_time"]);
            return $item;
        })->toArray();
        if(!empty($data["data"])) {
            foreach ($data["data"] as &$v) {
                if(numberEncryption($v["uniacid"]) == 1) {
                    $v["mobile"] = substr_replace($v["mobile"], "****", 2, 4);
                }
            }
        }
        return $data;
    }
    public static function getInfo($where)
    {
        $data = self::where($where)->alias("a")->field("a.id,a.uniacid,a.create_time,a.order_code,a.content,a.status,a.reply_content,a.reply_date,b.coach_name,b.mobile")->leftJoin("massage_service_coach_list b", "a.coach_id=b.id")->find();
        if($data) {
            $data["images"] = json_decode($data["images"], true);
            $data["create_time"] = date("Y-m-d H:i:s", $data["create_time"]);
        }
        if(numberEncryption($data["uniacid"]) == 1) {
            $data["mobile"] = substr_replace($data["mobile"], "****", 2, 4);
        }
        return $data;
    }
}

?>